@startuml UC07_sequence
!theme plain
hide footbox
skinparam sequenceMessageAlign center
skinparam responseMessageBelowArrow true
skinparam BoxPadding 10
autonumber

title UC-07 - Resume forward cleaning after a maneuver\n(sequence diagram)

actor "Home user\n(beneficiary)" as User
participant "Obstacle sensors" as Obs
box "Roomba RVC control software\n(inside the SSD black box)" #E8F4FF
  participant "perception:\nObstaclePerceptionContext" as Perception
  participant "navigation:\nNavigationAndEscapeCoordinator" as Nav
  participant "cleaning:\nSurfaceCleaningController" as Clean
end box
participant "Wheel motors\n(left, right)" as Motors
participant "Cleaning hardware" as CleanHW

note over User, Clean : after UC-03 / UC-04 / UC-05

Obs -> Perception : ObstacleStateChanged(forwardSafeAfterManeuver)
Perception -> Nav : FusedObstacleSnapshot(forwardSafe)
Nav -> Motors : MotionCommand(forward)
Nav -> Clean : ResumeCleaningAfterManeuver()
Clean -> CleanHW : CleaningCommand(active)

alt [typical]
  note over Nav, Motors : next: UC-02
else [A1 immediate re-obstacle]
  Obs -> Perception : ObstacleStateChanged(forwardBlocked)
  Perception -> Nav : FusedObstacleSnapshot(forwardBlocked)
  note over Perception, Nav : next: UC-03 or UC-05
else [E1 contradictory motion or cleaning]
  note over Nav, Clean : prevented by design; no runtime sequence
end

@enduml
